#!/usr/bin/env Python
#coding=utf-8
from flask import Flask
app = Flask(__name__)

from flask import request

@app.route('/hello')
def hello():
    return "hello"

@app.route('/test', methods=['GET','POST'])
def test():
    print "aaa"
    # return 'test'
    print "upload_file",request.files,request.form
    upload_file = request.files["png"]

    if upload_file:
        upload_file.save("./test"+upload_file.filename)
        return 'hello, success'
    else:
        return 'hello, failed'


if __name__ == '__main__':
    app.run(debug=True,host='0.0.0.0',port=5000)